package com.sevens.service.impl;


import java.util.List;

import com.sevens.dao.RoleDao;
import com.sevens.service.RoleService;
import com.sevens.vo.Role;
import com.sevens.vo.Rolepermission;

public class RoleServiceImpl  implements RoleService{
	
	private RoleDao roleDao;

	public RoleDao getRoleDao() {
		return roleDao;
	}
	
	public void setRoleDao(RoleDao roleDao) {
		this.roleDao = roleDao;
	}
	
	public boolean saveRole(Role role){
		
		if(roleDao.saveRole(role)!= null)
			return true;
		else
			return false;
	}

	public List<Role> queryRole(Role role) {
		
		return this.roleDao.queryRole(role);
	}

	public List<Role> queryAllRole() {
		return this.roleDao.queryAllRole();
	}

	public Role queryRoleById(int roleId) {
		
		Role role=this.roleDao.queryRoleById(roleId);
		return role;
	}
	public String queryPermission(int roleId)
	{
		return this.roleDao.queryPermission(roleId);
	}
	public boolean editRole(Role role) {
		
		boolean bool = this.roleDao.editRole(role);
		return bool;
	}

	public boolean deleteRoleById(int roleId) {
		
		boolean bool = this.roleDao.deleteRoleById(roleId);
		return bool;
	}

	public boolean deleteRole(Role role) {
		boolean bool = this.roleDao.deleteRole(role);
		return bool;
	}
	public String updatePermission(Rolepermission rolepermission)
	{
		return this.roleDao.updatePermission(rolepermission);
	}
}
